package astoliarskyi.wicket;

import astoliarskyi.wicket.card.Card;
import java.util.Calendar;

public class Wicket {

	private Calendar dateToday;

	void setDate(Calendar dateToday) {
		this.dateToday = dateToday;
	}

	public boolean letMeIn(Card card) {
		boolean decision = false;
		if (card != null && CoreSystem.INSTANCE.checkForValidity(card)) {
			decision = card.checkout(dateToday);
		}

		CoreSystem.INSTANCE.logAttempt(card, decision);
		return decision;
	}
}
